How can I do `dir *.mp3` in bash?

Posted by Andy on Super User See other posts from Super User or by Andy
Published on 2010-06-17T11:01:22Z Indexed on 2010/06/17 11:03 UTC
Read the original article Hit count: 439

Filed under:
|

Hi all,

On Windows I used to quickly run a dir *.mp3 to find all files with an mp3 extension in the current directory. Is there a similarly quick way to do it with bash? The ls command seems to have a way to ignore a pattern, but not to show only the pattern. I can do find . -maxdepth 1 -iname '*.mp3' or ls|grep -i '\.mp3$' but neither of these flow out of my fingers in half a second or less;)

Any quicker alternatives?

TIA

Andy

© Super User or respective owner

Related posts about bash

Related posts about find